package edu.ar.modulo4.ejb.beans;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.ejb.Stateless;

/**
 * Session Bean implementation class ConverterSLSB
 */
@Stateless
@PermitAll
public class ConverterSLSB {
	
	@Resource(name = "cotizacionDolar")
	private Double COTIZACION_DOLLAR;
	
	@Resource(name = "cotizacionEuro")
	private Double COTIZACION_EURO;

    /**
     * Default constructor. 
     */
    public ConverterSLSB() {        
    }

	
	public Double convertPesosToDollar(Double amount) {

		return amount * COTIZACION_DOLLAR;
	}

	
	public Double convertPesosToEuro(Double amount) {
		
		return amount * COTIZACION_EURO;
	}

	
	public Double convertDollarToPesos(Double amount) {

		return amount * (1/COTIZACION_DOLLAR);
	}

	
	public Double convertEuroToPesos(Double amount) {
		
		return amount * (1/COTIZACION_EURO);
	}

}
